<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/ad.js"></script>
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/unti.js"></script>
<title>广告<{$title}>页</title>
<script>
function  is_name_exist()
{
  $.get("http://cms.wondershare.com.br.wx/wondershare/ad_position.php?action=add_edit&w_type=<{$w_type}>", 
  {position_name: $("#position_name").val(),act: 'is_name_exist',position_id:$("#position_id").val()}, function(data)
  {

	 if(data >0)
	{
		 alert('广告位名称已经存在库中，请重新录入！');
        $("#position_name").focus();
		return false;
	}
 });
}
$(document).ready(function(){
  $("#position_name").blur(function() {
     is_name_exist();
      
  });
}); 
function check_submit()
{
  if($('#position_name').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
      alert('广告名称不能为空！');
      $("#position_name").focus();
      return false;
  }
  if($('#position_name').val().replace(/(^\s*)|(\s*$)/g, "")!="")
  {
      is_name_exist();
  }
  if($('#position_size').val().replace(/(^\s*)|(\s*$)/g, "")=="")
  {
     

      alert('广告位尺寸不能为空！');
      $("#position_size").focus();
      return false;
  }else
  {
      var patrn =  /^[0-9]{1,4}\*[0-9]{1,4}$/;
	  var position_size = $('#position_size').val();
	  if(!patrn.exec(position_size))
	  {
	    alert('广告位尺寸不正确！');
		$("#position_size").focus();
		return false;
	  }
      
  }
 
	
  return true;
}
</script>
</head>

<body>
<h1>

<span class="action-span1">
<a href="http://cms.wondershare.com.br.wx/wondershare/ad.php?action=index&w_type=<{$w_type}>"><{$web_info}>广告管理</a>
</span> 
<span id="search_id" class="action-span1"> > <a href="http://cms.wondershare.com.br.wx/wondershare/ad_position.php?action=index&w_type=<{$w_type}>">广告位管理</a></span>
<span id="search_id" class="action-span1"> > <{$title}>广告位</span>
<div style="clear:both"></div>
</h1>
<div id="tabbar-div">
      <p>
     
      </p>
    </div>
<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post" action="/wondershare/ad_position.php?action=add_edit&w_type=<{$w_type}>" onsubmit="return check_submit();">
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label">*广告位名称：</td>
            <td><input type="text" size="60" style="float:left;color:;" value="<{$position_info.position_name}>" name="position_name" id="position_name"> </td>
          </tr>
		  <tr>
            <td class="label">*广告位尺寸：</td>
            <td><input type="text" size="60" style="float:left;color:;" value="<{$position_info.position_size}>" name="position_size" id="position_size">&nbsp;&nbsp; <span style="color:#FF0000">如200*200这样的尺寸,宽和高不大于10000</span></td>
          </tr>
		  
		  <tr>
            <td class="label">广告位类型：</td>
            <td><select  name="position_type"  style="width:430px;">
			<option value="1" <{if $position_info.position_type == 1}> selected="selected" <{/if}>  >文章广告位</option>
			<option value="2" <{if $position_info.position_type == 2}> selected="selected" <{/if}> >resource广告位</option>
			<option value="3" <{if $position_info.position_type == 3}> selected="selected" <{/if}> >topic广告位</option>
			<option value="4" <{if $position_info.position_type == 4}> selected="selected" <{/if}> >tag广告位</option>
			<option value="5" <{if $position_info.position_type == 5}> selected="selected" <{/if}> >产品广告位</option>
			<option value="6" <{if $position_info.position_type == 6}> selected="selected" <{/if}> >产品store广告位</option>
			<option value="7" <{if $position_info.position_type == 7}> selected="selected" <{/if}> >survey广告位</option>
			</select>
            </td>
          </tr>
		  
		  <tr>
            <td class="label">广告位位置：</td>
            <td><select  name="position_location"  style="width:430px;">
			<option value="2" <{if $position_info.position_location == 2}> selected="selected" <{/if}> >右侧位置</option>
			<option value="1" <{if $position_info.position_location == 1}> selected="selected" <{/if}>  >上方位置</option>
			</select>
            </td>
          </tr>
		  
		  <tr>
            <td class="label">广告备注：</td>
            <td><textarea cols="60" rows="6" style="float:left;color:;"  name="position_description" id="position_description"><{$position_info.position_description}></textarea>
            </td>
          </tr>
		 
		      

        </tbody></table>

        <div  style="margin-left:380px; margin-top:20px;">
          <input type="hidden"  name="position_id" id="position_id" value="<{$position_info.position_id}>">
	      <input type="hidden"  id="w_type" name="w_type" value="<{$w_type}>" >
          <input type="submit"   class="button" value=" <{$title}> " name="sub_from">
          <input type="reset" class="button" value=" 重置 ">
        </div>
        <input type="hidden" value="<{$form_act}>" name="act" >
      </form>
    </div>
</body>
</html>